home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12950 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.primenet.com!not-for-mail
  2. From: gbe@primenet.com (Gary Edstrom)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: What is name-mangling? (mentioned in FAQ)
  5. Date: 22 Mar 1996 11:04:01 -0700
  6. Organization: Sequoia Software
  7. Sender: root@primenet.com
  8. Message-ID: <3152e97b.62546054@news.primenet.com>
  9. References: <4ik3s1$j7q@alcor.usc.edu>
  10. X-Posted-By: ip161.lax.primenet.com
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. Name-Mangling (also called decoration) is a method of encoding the number and
  14. types of parameters that a function takes into the name of the function.  Thus,
  15. the function prototype "void xyz(int x)" might look something like "$xyz$qvr"
  16. if you examine the object file.  This is required in C++ to produce type-safe
  17. linkage.  In C++, you are allowed to have functions that have the same name,
  18. but differ only in the number or types of parameters that they take.  This is
  19. something that is not allowed in normal C.  The compiler needs to resolve these
  20. identical names into unique names for the linker.  Thus, the need for mangled
  21. names.  The problem is that name mangling is not defined as a standard.
  22. Therefore, every compiler could use a different scheme and thus be unable to
  23. link in libraries created by another compiler.
  24.  
  25. I hope that helps,
  26.  
  27. Gary
  28.  
  29. wawda@alcor.usc.edu (Abu Wawda) wrote:
  30.  
  31. >Hi. One of the questions in the FAQ mentioned "name-mangling". The
  32. >question was about compatibility between different vendor's libraires
  33. >with a common name-mangling scheme. But what is "name-mangling"?
  34. >Thanks in advance,
  35.  
  36. --
  37. Gary Edstrom <gbe@primenet.com> | Sequoia Software
  38. PO Box 9573                     | Programming & Technical Services
  39. Glendale CA 91226-0573          | PGP Key ID: 0x1A0D44BD
  40. PGP Fingerprint: 72 AA 4F 73 05 53 89 C6  8A EE F4 EE D1 C0 13 8D 
  41.